import 'package:taonile/generated/json/base/json_convert_content.dart';
import 'package:taonile/entity/banner_for_home_entity.dart';

BannerForHomeEntity $BannerForHomeEntityFromJson(Map<String, dynamic> json) {
	final BannerForHomeEntity bannerForHomeEntity = BannerForHomeEntity();
	final int? code = jsonConvert.convert<int>(json['code']);
	if (code != null) {
		bannerForHomeEntity.code = code;
	}
	final String? msg = jsonConvert.convert<String>(json['msg']);
	if (msg != null) {
		bannerForHomeEntity.msg = msg;
	}
	final List<BannerForHomeData>? data = jsonConvert.convertListNotNull<BannerForHomeData>(json['data']);
	if (data != null) {
		bannerForHomeEntity.data = data;
	}
	return bannerForHomeEntity;
}

Map<String, dynamic> $BannerForHomeEntityToJson(BannerForHomeEntity entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['code'] = entity.code;
	data['msg'] = entity.msg;
	data['data'] =  entity.data.map((v) => v.toJson()).toList();
	return data;
}

BannerForHomeData $BannerForHomeDataFromJson(Map<String, dynamic> json) {
	final BannerForHomeData bannerForHomeData = BannerForHomeData();
	final String? id = jsonConvert.convert<String>(json['id']);
	if (id != null) {
		bannerForHomeData.id = id;
	}
	final String? imgPath = jsonConvert.convert<String>(json['img_path']);
	if (imgPath != null) {
		bannerForHomeData.imgPath = imgPath;
	}
	final String? link = jsonConvert.convert<String>(json['link']);
	if (link != null) {
		bannerForHomeData.link = link;
	}
	final String? sort = jsonConvert.convert<String>(json['sort']);
	if (sort != null) {
		bannerForHomeData.sort = sort;
	}
	return bannerForHomeData;
}

Map<String, dynamic> $BannerForHomeDataToJson(BannerForHomeData entity) {
	final Map<String, dynamic> data = <String, dynamic>{};
	data['id'] = entity.id;
	data['img_path'] = entity.imgPath;
	data['link'] = entity.link;
	data['sort'] = entity.sort;
	return data;
}